package com.bolt.auth.security.common.exception;

import com.bolt.convention.data.code.ServiceCode;
import org.springframework.http.HttpStatus;

/**
 * Created by Administrator on 2019/9/3.
 */
public class UnauthorizedException extends Auth2Exception {

    public UnauthorizedException(ServiceCode respCode, Throwable cause) {
        super(respCode, cause);
    }

    public UnauthorizedException(String msg, Throwable t) {
        super(msg, t);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "unauthorized";
    }

    @Override
    public int getHttpErrorCode() {
        return HttpStatus.UNAUTHORIZED.value();
    }
}
 